import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
import { DemoService } from './demo.service';
import { DemoController } from './demo.controller';
import  { MiddlewareMiddleware } from './../middleware/index'

@Module({
  controllers: [DemoController],
  providers: [DemoService],
  exports:[DemoService]
})
export class DemoModule implements NestModule{
  configure(consumer: MiddlewareConsumer) {
      consumer.apply(MiddlewareMiddleware).forRoutes(DemoController)
  }
}
